import 'package:json_annotation/json_annotation.dart';

part 'device.g.dart';

///
/// 设备
///
@JsonSerializable()
class DeviceModel {
  @JsonKey(name: 'img_url')
  String imgUrl;

  String name;

  String code;

  String location;

  DeviceModel(
      {required this.imgUrl, required this.name, required this.code, required this.location});

  factory DeviceModel.fromJson(Map<String, dynamic> json) => _$DeviceModelFromJson(json);

  Map<String, dynamic> toJson() => _$DeviceModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}
